<script lang="ts" setup>
import { defineProps } from 'vue';

//  父传子
const { title, isshow } = defineProps({
    title: String,  //首字母大写
    isshow: Boolean  //是否显示右侧按钮
})

</script>
<template>
    <header>
        <van-icon v-if="isshow" @click="$router.back()" name="arrow-left" />
        <!-- <slot name="middle"></slot> -->
        <h3>{{ title }}</h3>
        <!-- <v-slot name="right" v-if="ishow">  -->
        <!-- </v-slot>    不能用v-slot  v-slot是个指令  slot是个插槽标签  具名插槽-->
        <slot name="right"></slot>
    </header>
</template>

<style lang="scss" scoped>
header {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    background-color: white;
}

.van-icon {
    position: relative;
    right: 140px;
    font-size: 16px;
}

// b{
//     position: relative;
//     left: 40px;

// }</style>